package com.example.demo1.dao;

import com.example.demo1.domain.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author sherry
 * @description
 * @date Create in 2019/10/17
 * @modified By:
 */

public interface UserMapper {


    /**
     * 查询
     *
     * @param username
     * @return
     */
    @Select("select * from user where username = #{username}")
    User findByUsername(@Param("username") String username);

    /**
     * 查询
     *
     * @param id
     * @return
     */
    @Select("select * from user where id = #{id}")
    User findById(@Param("id") Integer id);

    /**
     * 查询
     *
     * @param username
     * @param pwd
     * @return
     */
    @Select("select * from user where username = #{username} and password = #{pwd}")
    User findByUsernameAndPwd(@Param("username") String username, @Param("pwd") String pwd);
}
